package com.example.springboot_practice.Controller;

import com.example.springboot_practice.Entity.Book;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @Description: SpringBoot整合Web开发
 * @Author 王宝凯
 * @Date 2020/9/8
 */
@RestController
public class BookController {
    @GetMapping("/book")
    public Book book(){
        Book book = new Book();
        book.setAuthor("罗贯中");
        book.setName("三国演义");
        book.setPrice(30f);
        book.setPublicationDate(new Date());
        return book;
    }
}
